#for(y : col)
<div class="form-group" style="display:#(display??)">
   #for(x : y)
      #if(!ifEmpty(x.title))
			<div class="page-header-form">
				<h2 style="#(x.style??)">
					#(x.title??)
				#if(!ifEmpty(x.small))
					<small>
						<i class="fa fa-angle-double-right">
							#(x.small??)
						</i>
					</small>
				#end
				</h2>
			</div>
	 #else
        #setLocal(display = (like(x.type,"hidden")) ? "none" : "block")
        #setLocal(placeholder = (!ifEmpty(x.placeholder)) ? x.placeholder : ("暂无"+x.name))
	            #if(x.hastitle??true)
				<label class="col-sm-#(x.labellen??2) control-label no-padding-right"  style="#(x.titlestyle??)"> #(x.name??) </label>
				#end		
				<div class="col-sm-#(x.length??3)">
				#if(x.type=="textarea")
					<textarea id="_#(x.index??)" style="height:#(x.height??'200px')" name="#(table??).#(x.index??)" disabled value="#(x.value??)" placeholder="#(placeholder??)" class="form-control"></textarea>
				#else if(x.type=="image")
					<img id="_#(x.index??)"  data-type="image" data-auto="#(x.auto??)" style="padding:2px; border:1px solid #ccc;cursor:pointer;width:#(x.width??'168px');height:#(x.height??'110px');" name="#(table??x.table).#(x.index??)" src="#(x.src??)"></img>
				#else if(like(x.type,"select_"))
				    #setLocal(num = getNumByType(x.type,"select_",""))
				    #select("dict",num,table+"."+x.index,x.value??0,x.tail??,x.required??)
				#else if(x.type=="selectStatic")
					#select("static","",table+"."+x.index,x.value??'',x.tail??,x.required??'',x.source??'',"")
				#else if(x.type=="kindeditor")
				     #@kindeditor(x)
				#else if(x.type=="ueditor")
					 #@ueditor(x)
				#else if(x.type=="checkbox")
					 #@checkbox(x)
				#else if(x.type=="checkbox2")
					 #@checkbox2(x)
			    #else if(x.type=="radios")
					 #@radios(x)
				#else if(x.type=="imgupload")
					 #@imgupload(x)
				#else if(x.type=="multiimgupload")
				     #@multiimgupload(x)
				#else if(x.type=="fileupload")
					 #@fileupload(x)
				#else if(x.type=="uploadify")
			    	 #@uploadify()
			    #else if(x.type=="upload")
					 #@upload(x)
			    #else if(like(x.type,"opentree"))
					#@opentree(x,placeholder)
				#else if(like(x.type,"selecttree"))
					#@selecttree(x,placeholder)
				#else if(x.type=="hidden")
					<input type="hidden" id="_#(x.index??)" name="#(table??).#(x.index??)"  value="#(x.value??)" />
				#else if(x.type=="span")
				    #@span(x)
				#else if(x.type=="iframe")
				    <div style="width:100%;text-align:right">
						<iframe id="_#(x.index??)"  src="#(x.value??)" width="#(x.width??)" height="#(x.height??)"  >
						</iframe>
					</div>
				#else
				     <input type="text" id="_#(x.index??)" name="#(table??).#(x.index??)" disabled value="#(x.value??)" placeholder="#(placeholder??)" class="form-control" autocomplete="off"/>
				#end
				</div>
    	#end
   #end
</div>
#end
			<script	type="text/javascript">
				$(function(){
					var _model = #(model??"'error'");
					if(_model == "error"){
						layer.msg('读取数据失败!', {icon: 5});
						return;
					}
					for(var x in _model){
						var child = _model[x];
					    setVal(x,child);
					}
					
				});
				//为元素赋值
				function setVal(id,value){//id当前元素id,value 需要的值
					var je = $("#_" + id);
				    var eleId = id;
					if(value != null && je.attr("data-type")=="image"){
						var src = je.attr("data-auto") + value;
						je.attr("src", src);
						je.bind("click", function(){
							window.open($(this).attr("src"));
						});
					}
					else if(value != null && je.attr("data-type") == "imgupload"){
						var id = value;
						var functionName = "_"+eleId+"_initImgUpload";
						eval(functionName+"(id,'view');");
						je.val(id);
					}
					else if(value != null && je.attr("data-type") == "multiimgupload"){
						var id = value;
						var functionName = "_"+eleId+"_initMultiImgUpload";
						je.val(id);
						eval(functionName+"(id,'view');");
					}
					else if(value != null && je.attr("data-type") == "upload"){
						var id = value;
						var functionName = "_"+eleId+"_inituploadview";
						je.val(id);
						eval(functionName+"(id,'view');");
					}
					else if(value != null && je.attr("data-type") == "fileupload"){
						var id = value;
						var functionName = "_"+eleId+"_initFileUpload";
						je.val(id);
						eval(functionName+"(id,'view');");
					}
					else if(value != null && je.attr("data-type") == "uploadify"){
						var id = value;
						je.val(id);
						var functionName = "_"+eleId+"_inituploadifyUpload";
						eval(functionName+"(id,'view');");
					}
					else if(value != null && je.attr("data-type") == "opentree"){
						var ids = value;
						je.val(ids);
						var functionName = "_"+eleId+"_initOpenTree";
						eval(functionName+"(ids);");
					}
					else if(value != null && je.attr("data-type") == "selecttree"){
						var ids = value;
						je.val(ids);
						initSelectTree(ids);
					}
					else if(je.is("span")){
						/* var _x = value;
						if(_x == null || _x == ""){
							_x = "请选择";
						}
						je.html(_x); */
						var functionName = "_"+eleId+"_initSpan";
						eval(functionName+"(value);");
					}
					else if(value!=null && $("#_" + id + "_chb").attr("type")=="checkbox"){
						je.val(value);
						var functionName = "_"+id+"_initcheckbox";
						eval(functionName+"(value);");
					}
					else if(value != null && je.attr("data-type") == "radios"){
						var _ele = "#_" +id+"_radio"+_value;
						$(_ele).attr("checked","checked");
						je.val(value);
					}
					else if(value != null && je.attr("data-type") == "ueditor"){
						var functionName = "_"+id+"_initueditor";
						eval(functionName+"(value);");
					}
					else if(value!=null && je.is("iframe")){
						je.attr("src",value); 
					}
					else if(value != null && je.attr("data-type") == "kindEditor"){
						je.val(value);
						var functionName = "_"+eleId+"_initkindeditor";
						eval(functionName+"();");
					}else{
						if(value!=null){
							je.val(value);
						}
					}
				}
			</script>
